import { Injectable, EventEmitter } from '@angular/core';

@Injectable()
export class LoadingService {

    private isShowloading = false;
    public loadingEvent = new EventEmitter<boolean>();

    constructor() { }

    public loading(isShow: boolean = true) {
        this.isShowloading = isShow;
        this.loadingEvent.emit(isShow);
    }

    public isLoading() {
        return this.isShowloading;
    }

}
